<!DOCTYPE html>
<html>
<meta charset="utf-8">
<meta content="IE=9" http-equiv="x-ua-compatible">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox-content">
				<div class="ibox">
					<div class="ibox-body">
						<div class="fixed-table-toolbar">
							<div class="columns pull-right" style="margin-right: 66px">
								<button class="btn btn-success" onclick="reLoad()">查询</button>
							</div>
							<div class="columns pull-left" style="width: 13%;margin-left: 69px">
								<input type="text" style="width: 160px;height: 36px;" placeholder="开始时间" class="layui-input" name="sTime" id="sTime">
							</div>
							<div class="columns pull-left" style="width: 13%;margin-left: 73px">
								<input type="text" style="width: 160px;height: 36px;" placeholder="结束时间" class="layui-input" name="eTime" id="eTime">
							</div>
						</div>
					</div>
				</div>
				<form class="form-horizontal m-t" style="margin-top: 60px" id="signupForm">

					<!--<div class="form-group">
						<label class="col-sm-3 control-label">个人订单数量：</label>
						<div class="col-sm-8">
							<input id="mineNum" name="mineNum" class="form-control" type="text">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">个人订单金额：</label>
						<div class="col-sm-8">
							<input id="mineMoney" name="mineMoney" class="form-control" type="text">
						</div>
					</div>-->
					<div class="form-group">
						<label class="col-sm-3 control-label">团队业绩：</label>
						<div class="col-sm-8">
							<input id="tprice" name="tprice" class="form-control" type="text">
						</div>
					</div>
					<!--<div class="form-group">
						<label class="col-sm-3 control-label">团队业绩订单数：</label>
						<div class="col-sm-8">
							<input id="toNumber" name="toNumber" class="form-control" type="text">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">团队业绩商品数：</label>
						<div class="col-sm-8">
							<input id="tgNumber" name="tgNumber" class="form-control" type="text">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">个人业绩：</label>
						<div class="col-sm-8">
							<input id="gprice" name="gprice" class="form-control" type="text">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">个人业绩订单数：</label>
						<div class="col-sm-8">
							<input id="goNumber" name="goNumber" class="form-control" type="text">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">个人业绩商品数：</label>
						<div class="col-sm-8">
							<input id="ggNumber" name="ggNumber" class="form-control" type="text">
						</div>
					</div>-->
					<div class="columns pull-right" style="margin-right: 66px">
						<button class="btn btn-success" onclick="memberDatailList()">查看详情</button>
					</div>

				</form>
			</div>
		</div>
	</div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" src="/css/plugins/laydate/laydate.js"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/js/layui.js"></script>
<script  th:inline="javascript">
	var user_id = [[${userId}]]
	var prefix = "/beaut/memberUser"
	$(function() {
		times();
		reLoad();
	});

	function times() {
		laydate.render({
			elem: '#sTime' //指定元素
			//,format: 'yyyy-MM-dd HH:mm:ss' //可任意组合
			,type: 'datetime'
			/*,value: ''+time+''  //初始值*/
		});
		laydate.render({
			elem: '#eTime' //指定元素
			,type: 'datetime'
			//,format: 'yyyy-MM-dd HH:mm:ss' //可任意组合
		});
		//$('#sTime').val(time);
	}

	function reLoad() {
		var map = {};
		map["userId"] = user_id;
		map["sTime"] = $('#sTime').val().replace(/^\s*|\s*$/g,"");
		map["eTime"] = $('#eTime').val().replace(/^\s*|\s*$/g,"");

		$.ajax({
			url : prefix+"/getMemberDetails",
			type : "post",
			data : map,
			success : function(r) {
				if (r.code==0) {
					var data = r.data;
					$('#mineNum').val(data.mineNum);
					$('#mineMoney').val(data.mineMoney);
					$('#tprice').val(data.tprice);
					$('#toNumber').val(data.toNumber);
					$('#tgNumber').val(data.tgNumber);
					$('#gprice').val(data.gprice);
					$('#goNumber').val(data.goNumber);
					$('#ggNumber').val(data.ggNumber);
				}else{
					layer.msg(r.msg);
				}
			}
		});
	}

	function memberDatailList(){
		var sTime = $('#sTime').val()+"";
		var eTime = $('#eTime').val()+"";
		console.log(prefix + '/teamUser?userId='+user_id+'&eTime='+eTime+'&sTime='+sTime);
		layer.full(parent.layer.open({//或者用 top
			type : 2,
			title : '业绩详情',
			maxmin : true,
			shadeClose : false, // 点击遮罩关闭层
			area : [ '850px', '620px' ],
			content : prefix + '/teamUser?userId='+user_id+'&eTime='+eTime+'&sTime='+sTime// iframe的url
		}));
		/*var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
		parent.layer.close(index); //再执行关闭*/
	}



</script>
</body>
</html>
